
<div class="distance_calculator">
      <h2>Distance Calculator</h2>
<%if @lap %>
      <input id='lap' class="text" type="text" value="<%= @lap %>" /> Laps = 1 mile
<%else%>
      <input id='lap' class="text" type="text" value="" /> Laps = 1 mile
<%end%>
</div>
<br />
    
    
<%if params[:runner_id]%>
  <input id="runner_id" name="entry[runner_id]" type="hidden" value = <%=params[:runner_id]%>/>
<%elsif @runner%>
  <input id="runner_id" name="entry[runner_id]" type="hidden" value = <%=@runner.id%>/>
<%else%>
<p>
  <%= f.label :runner_id %><br />
  <%= collection_select(:entry, :runner_id, Runner.find(:all), :id, :name, {:prompt => true}) %>
</p>
<%end%>

<p>
  Number of times the runner ran since the last entry<br />
  <%= f.text_field :sessions %>
</p>
<p>
  Number of total laps ran<br />
  <input id="entry_distance" name="entry[distance]" size="30" type="hidden" />
  <input id="laps_ran" name="entry[distance]" size="30" type="text" />
</p>
<p>
  Most recent run date<br>
  <%= f.date_select :date, :end_year => Time.now().year%>
</p>
